﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FoodBookDetails_Admin.aspx.cs"
    Inherits="Admin_FoodBookDetails_Admin" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Food Book Details</title>
    <script type="text/javascript">
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)				
            return oWindow;
        }
        function CloseWnd()
        {
            GetRadWindow().close();
        }
        function reloadParentPage()
        {
            var parentPage = GetRadWindow().BrowserWindow;
            parentPage.reloadPage();
            CloseWnd();           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    
    <asp:ScriptManager ID="ScriptManager" runat="server" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EatDrinkConnectionString %>"
        SelectCommand="SELECT * FROM [FoodBook] WHERE ([FoodBookID] = @FoodBookID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="FoodBookID" QueryStringField="FoodBookID" Type="Int64" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:EatDrinkConnectionString %>"
        SelectCommand="SELECT * FROM [FoodStyle]"></asp:SqlDataSource>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Width="100%"
        Height="100%" DataSourceID="SqlDataSource1">
        <Fields>
            <asp:TemplateField HeaderText="Kiểu Món Ăn" SortExpression="FoodStyleID">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlFoodStyleID" runat="server" DataSourceID="SqlDataSource2"
                        DataTextField="FoodStyleName" DataValueField="FoodStyleID" SelectedValue='<%# Bind("FoodStyleID") %>'
                        Width="231px" Height="22px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="ddlFoodStyleID" runat="server" DataSourceID="SqlDataSource2"
                        DataTextField="FoodStyleName" DataValueField="FoodStyleID" SelectedValue='<%# Bind("FoodStyleID") %>'
                        Width="231px" Height="22px">
                    </asp:DropDownList>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tên Món Ăn" SortExpression="Title">
                <EditItemTemplate>
                    <asp:TextBox ID="txtTitle" runat="server" Text='<%# Bind("Title") %>' Width="229px"
                        Height="21px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Nhập Tên Food Book !!"
                        ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="txtTitle" runat="server" Text='<%# Bind("Title") %>' Width="229px"
                        Height="21px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" Font-Size="Medium"
                        ControlToValidate="txtTitle" ErrorMessage="Nhập Tên Food Book !!"></asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Miêu Tả Món Ăn" SortExpression="ShortDescription">
                <EditItemTemplate>
                    <telerik:RadEditor Style="height: 300px; overflow: auto" EnableResize="false" Height="350px"
                        ID="RadEditorShort" runat="server" Width="500px" Content='<%#Bind("ShortDescription") %>'
                        Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                        <Content>
                        </Content>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Bạn Chưa Nhập Miêu Tả Món Ăn!!!"
                        Font-Size="Medium" ControlToValidate="RadEditorShort"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadEditor Style="height: 300px; overflow: auto" EnableResize="false" Height="350px"
                        ID="RadEditorShort" runat="server" Width="500px" Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                        <Content>
                        </Content>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="RadEditorShort"
                        Font-Size="Medium" ErrorMessage="Bạn Chưa Nhập Miêu Tả Món Ăn!!!"></asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Nguyên Liệu">
                <EditItemTemplate>
                    <telerik:RadEditor ID="RadEditorNguyenLieuEdit" Style="height: 300px; overflow: auto"
                        EnableResize="false" Height="350px" runat="server" Width="500px" Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="RadEditorNguyenLieuEdit"
                        Font-Size="Medium" ErrorMessage="Bạn Chưa Nhập Nguyên Liệu!!!"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadEditor ID="RadEditorNguyenLieuInsert" Style="height: 300px; overflow: auto"
                        EnableResize="false" Height="350px" runat="server" Width="500px" Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                        <Content>
                            <ul>
                              <li> </li>
                            </ul>
                        </Content>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="RadEditorNguyenLieuInsert"
                        Font-Size="Medium" ErrorMessage="Bạn Chưa Nhập Nguyên Liệu!!!"></asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Thực Hiện">
                <EditItemTemplate>
                    <telerik:RadEditor ID="RadEditorThucHienEdit" Style="height: 300px; overflow: auto"
                        EnableResize="false" Height="350px" runat="server" Width="500px" Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="RadEditorThucHienEdit"
                        Font-Size="Medium" ErrorMessage="Bạn Chưa Nhập Cách Thực Hiện!!!"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadEditor ID="RadEditorThucHienInsert" Style="height: 300px; overflow: auto"
                        EnableResize="false" Height="350px" runat="server" Width="500px" Skin="Web20">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" />
                                <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                <telerik:EditorTool Name="FontName" />
                                <telerik:EditorTool Name="RealFontSize" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                            </telerik:EditorToolGroup>
                        </Tools>
                        <Content>
                            <ul>
                              <li> </li>
                            </ul>
                        </Content>
                    </telerik:RadEditor>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadEditorThucHienInsert"
                        Font-Size="Medium" ErrorMessage="Bạn Chưa Nhập Cách Thực Hiện!!!"></asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Hình Món Ăn" SortExpression="News Image">
                <EditItemTemplate>
                    <asp:FileUpload ID="FileUpload1" runat="server" Width="381px" Font-Size="Medium"
                        Height="26px" />
                    <br />
                    <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" ImageUrl='<%# Eval("Image", "~/Images/Foods/{0}") %>' />
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:FileUpload ID="FileUpload1" runat="server" Width="381px" Font-Size="Medium"
                        Height="26px" />
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IsShowHomePage" SortExpression="IsShowHomePage">
                <EditItemTemplate>
                    <asp:TextBox ID="txtPath" runat="server" Height="22px" Text='<%# Bind("Path") %>'
                        Width="231px"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="txtPath" runat="server" Height="22px" Text='<%# Bind("Path") %>'
                        Width="231px"></asp:TextBox>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlIsActivated" runat="server" AppendDataBoundItems="True"
                        DataSource='<%# (new string[] {"True", "False"}) %>' Enabled="true" Font-Size="Medium"
                        Height="22px" SelectedValue='<%# Eval("IsShowHomePage") %>' Width="231px">
                    </asp:DropDownList>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="ddlIsActivated" runat="server" AppendDataBoundItems="True"
                        DataSource='<%# (new string[] {"True", "False"}) %>' Enabled="true" Font-Size="Medium"
                        Height="22px" Width="231px">
                    </asp:DropDownList>
                </InsertItemTemplate>
                <HeaderStyle VerticalAlign="Top" />
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
    <div align="right">
        <asp:Button ID="Button3" runat="server" Text="Button" OnClick="Button3_Click" BackColor="#D2E6FA"
            Font-Bold="True" ForeColor="red" Font-Size="Medium" Font-Strikeout="False" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button4" runat="server" Text="Cancel" OnClientClick="CloseWnd();return false;"
            BackColor="#D2E6FA" Font-Bold="True" ForeColor="red" Font-Size="Medium" />
    </div>
    </form>
</body>
</html>
